home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / master / Examples / Printer_Driver / tag.a < prev    next >
Text File  |  1994-02-01  |  3KB  |  146 lines

  1.  
  2.             ;    TAG.A
  3.             ;
  4.             ;    printer tag info and custom startup code for
  5.             ;    DICE.
  6.  
  7.             section text,code
  8.  
  9.             xref    _DevInit
  10.             xref    _DevExpunge
  11.             xref    _DevOpen
  12.             xref    _DevClose
  13.  
  14.             xref    _CommandTable
  15.             xref    _DoSpecial
  16.             xref    _Render
  17.             xref    _ExtendedCharTable
  18.  
  19.             xdef    _PEDData
  20.             xdef    _SysBase
  21.  
  22.             moveq.l #0,D0
  23.             rts
  24.             dc.w    37    ; version
  25.             dc.w    0    ; revision
  26.  
  27. _PEDData:
  28.             dc.l    printerName
  29.             dc.l    _ADevInit
  30.             dc.l    _ADevExpunge
  31.             dc.l    _DevOpen
  32.             dc.l    _DevClose
  33.  
  34.             dc.b    $01     ; printer class (devices/prtbase.h)
  35.             dc.b    $01     ; color class    (devices/prtbase.h)
  36.             dc.b    136     ; maximum number of columns
  37.             dc.b    10        ; number of character sets
  38.  
  39.             dc.w    24        ; number of pixel rows per line dump
  40.             dc.l    1088    ; max X dots in 360dpi mode
  41.             dc.l    0        ; max Y dots -- none, continuous
  42.             dc.w    80        ; density, dpi horizontal
  43.             dc.w    180     ; density, dpi vertical
  44.  
  45.             ;    command table & special functions
  46.  
  47.             dc.l    _CommandTable
  48.             dc.l    _DoSpecial
  49.             dc.l    _Render
  50.             dc.l    30            ; timeout
  51.             dc.l    _ExtendedCharTable    ; 8BitChars
  52.             ds.l    1            ; printer mode (reserve space)
  53.             dc.l    0            ; character conversion
  54.  
  55. printerName:        dc.b    'EpsonQTest',0
  56.  
  57.             ds.l    0
  58.  
  59.  
  60.             ;    -------------------------------------------------
  61.             ;    custom DICE startup code, same as for shared
  62.             ;    library example except args passed on stack, not
  63.             ;    in registers.
  64.  
  65.             xref    __BSS_LEN        ; (dlink), length of BSS
  66.             xref    __DATA_BAS        ; (dlink), base of initialized data
  67.             xref    __DATA_LEN        ; (dlink), length of data
  68.  
  69. _ADevInit:
  70.  
  71.             movem.l D2-D7/A2-A6,-(sp)   ; blanket save
  72.             move.l  4,A6        ; EXEC base
  73.  
  74.             ;    Not resident, BSS space has been allocated for us
  75.             ;    beyond the specified data, just load the base ptr
  76.  
  77. snotres         lea     __DATA_BAS+32766,A4
  78.             sub.l   A3,A3
  79.  
  80. clrbss
  81.             ;    CLEAR BSS   &-32766(A4) + __DATA_LEN*4
  82.  
  83.             lea     -32766(A4),A0
  84.             move.l  #__DATA_LEN,D0
  85.             asl.l   #2,D0
  86.             add.l   D0,A0
  87.  
  88.             move.l  #__BSS_LEN,D0    ; longwords of bss
  89.             moveq.l #0,D1
  90.             bra     clrent
  91. clrlop            move.l  D1,(A0)+
  92. clrent            dbf     D0,clrlop
  93.             sub.l   #$10000,D0
  94.             bcc     clrlop
  95.  
  96.             move.l  A6,_SysBase
  97.  
  98.             jsr     __AutoInit0     ; A6 has SYSBase
  99.             bne     xfail
  100.             jsr     __AutoInit1     ; A6 has SYSBase
  101.             bne     xfail
  102.  
  103.             movem.l (sp)+,D2-D7/A2-A6   ; blanket restore
  104.             jmp     _DevInit(pc)        ; argument 4(sp) (on stack)
  105.  
  106.             ;    if failure occurs (auto library open failed), return
  107.             ;    -1
  108.  
  109. xfail            movem.l (sp)+,D2-D7/A2-A6
  110.             moveq.l #-1,D0
  111.             rts
  112.  
  113.             ;    expunge the device
  114.  
  115. _ADevExpunge:
  116.             jsr     _DevExpunge(pc)
  117.             movem.l A4/A6,-(sp)
  118.             move.l  4.W,A6
  119.             lea     __DATA_BAS+32766,A4
  120.             jsr     __AutoExit1
  121.             jsr     __AutoExit0
  122.             movem.l (sp)+,A4/A6
  123.             moveq.l #0,D0
  124.             rts
  125.  
  126.             ;    These are special DICE sections that merge together special
  127.             ;    code from other object modules and link libraries, the base
  128.             ;    of which is defined here.
  129.  
  130.             section autoinit0,code
  131. __AutoInit0:
  132.             section autoinit1,code
  133. __AutoInit1:
  134.             section autoexit0,code
  135. __AutoExit0:
  136.             section autoexit1,code
  137. __AutoExit1:
  138.  
  139.             section bss,bss
  140.  
  141. _SysBase        ds.l    1
  142.  
  143.             END
  144.  
  145.  
  146.